home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Hyper Stacks 1994 May
/
Hyper Stacks (Pacific HiTech)(1994)[Mac].iso
/
Utilities
/
versioncontrol.script
< prev
next >
Wrap
Text File
|
1994-05-18
|
2KB
|
74 lines
on VersionSave
-- Version Control System, copyright 1990 bill coderre
-- This program may be distributed freely with this copyright
-- notice intact.
-- start to calculate the new name of the stack
put the short name of this stack into name
put the second word of the long name of this stack into namepath
delete the first character of namepath
delete the last character of namepath
put name into newname
get the last word of name
-- check for proper stack name syntax
if it is not an integer then
answer "The stack name doesn't end with a number." ~
& return & return & "Can't do version control." with "Cancel"
exit to Hypercard
end if
-- ok, so make the new name
add 1 to it
put it into the last word of newname
put it into the last word of namepath
-- check for overwriting an existing stack
if there is a stack namepath then
answer "There is already a stack called" && quote & ~
newname & quote & "." & return & return & ~
"Can't do version control." with "Cancel"
exit to Hypercard
end if
-- check for new name too long
if the number of characters in newname > 29 then
answer "The new name of this stack (" & quote & ~
newname & quote & ") is too long." & return & return & ~
"Can't do version control." with "Cancel"
exit to Hypercard
end if
-- check for enough diskspace
put the size of this stack into mySize
put the freeSize of this stack into myFree
if 2 * (mySize - myFree) > the diskSpace then
answer "There isn't enough disk space to proceed." ~
& return & return & ~
"Can't do version control." with "Cancel"
exit to Hypercard
end if
-- stow the message box visibility and contents
put msg into mtemp
put the visible of msg into mvis
-- Compact the stack
put "Compacting stack..."
doMenu "Compact Stack"
-- now change the name of the stack to the new name
put "Updating stack version number..."
set the name of this stack to newname
-- save a copy under the old name
save this stack as name
-- stow the message box visibility and contents
put mtemp into msg
set the visible of msg to mvis
end VersionSave